import request from '@/utils/request'

/**
 * 获取病理类型
 * @returns {*}
 */
export function getPathology() {
    return request({
        url: '/triage/tbt/getPathology',
        method: 'GET'
    })
}

/**
 * 获取申请医院信息
 * @returns {*}
 */
export function getApplayForHospital() {
    return request({
        url: '/freezing/maa/getHospital',
        method: 'GET'
    })
}

export function getTbd(status, pathology, sendHospital, caseNo, name, pageNum, pageSize) {
    const data = {
        status,
        pathology,
        sendHospital,
        caseNo,
        name
    }
    return request({
        url: '/triage/tbt/getTbd',
        method: 'POST',
        data: data,
        params:{
            pageNum: pageNum,
            pageSize: pageSize
        }
    })
}

export function allotCase(caseList){
    return request({
        url: 'triage/tbt/allotCase',
        method: 'PUT',
        data: caseList
    })
}

export function returnSite(id){
    return request({
        url: 'triage/tbt/returnSite/'+id,
        method: 'PUT',
    })
}

export function getDiagnosticReport(id){
    return request({
        url: 'triage/tbt/getDiagnosticReport/'+id,
        method: 'GET'
    })
}

export function revocation(caseId,reason){
    return request({
        url: 'triage/tbt/revocation/'+caseId+'?reason='+reason,
        method: 'PUT'
    })
}